package com.handinglian.ai.record.enums;

public enum CallTypeEnum {
    CALL_IN(1,"呼入"),
    MANUAL_CALL_OUT(2,"手动呼出"),
    AUTO_CALL_OUT(3,"自动呼出"),
    INNER(4,"内线"),
    CYCLE(5,"环回测试");

    public static CallTypeEnum valueOfOrdinal(Integer ordinal) {
        return ordinal == null || ordinal >= values().length ? null : values()[ordinal];
    }
    public static CallTypeEnum valueOfDesc(String desc) {
        for(CallTypeEnum callTypeEnum : CallTypeEnum.values()){
            if(desc.equals(callTypeEnum.getDescription())){
                return callTypeEnum;
            }
        }
        return null;
    }
    public static CallTypeEnum valueOfKey(Integer key){
        for(CallTypeEnum callTypeEnum : CallTypeEnum.values()){
            if(callTypeEnum.getKey()==key){
                return callTypeEnum;
            }
        }
        return null;
    }
    private final Integer key;
    private final String description;

    CallTypeEnum(Integer key, String description) {
        this.key = key;
        this.description = description;
    }

    public Integer getKey() {
        return key;
    }
    public String getDescription() {
        return this.description;
    }
}
